package com.hllxd.hism.star.basic.service.service;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * author: xiyong.lxy
 * date: 2020-10-12 16:51
 */
@Slf4j
@Service("testService")
public class TestServiceImpl implements TestService {

    // http://local-hllxd.tiaofangzi.com:8981/hllxd/api/request/basic/v1/101/testService/helloStr
    // {"service":"basic","path":"/usercenter/v1/helle/list","params":{"p1":1,"p2":"234"}}
    @Data
    public static class A {
        private Integer p1;
        private String p2;
        private String p3;
    }
    @Override public String helloStr(Object a) {
        log.info("a: {}", a);
        A aa = ((JSONObject) a).toJavaObject(A.class);

        log.info("{}, {}, {}.", aa.getP1(), aa.getP2(), aa.getP3());

        return a.toString();
    }
}
